<script type="text/javascript">
function OnSubmitForm()
{
  if(document.pressed == 'up')
  {
    document.myform.action ="uploadfile";
  }
 
</script>
<form name="myform" onsubmit="OnSubmitForm()" method="post" enctype="multipart/form-data">
	<div align="center">
	<table border="1" width="100%" id="table1">
	<tr>
			<tr>
			<td width="110">
			<p align="right">Tên bài viết:</td>
			<td width="183">
				<p align="left"><select name="article[event_id]">
									<% @articles.each do |article| %>
										<option value= <%= article.id %> > <%= article.title %></option>
									<% end %>					
								</select>
				</p>
			</td>
			<td rowspan="2"><img border="0" src="" name="I1" width="200" height="150" type="image"></td>
		</tr>
		<tr>
			<td width="110" height="47">
			<p align="right">Tên sự kiện:</td>
			<td width="23" height="47"><select name="event[channel_id]">
									<% @events.each do |event| %>
										<option value= <%= event.id %> > <%= event.name %></option>
									<% end %>					
								</select>
				</select>
			</td>
			
		</tr>
		<tr>
			<td height="23">
				<p>
				
				</p>
			</td>
			<td>
				
			 </td>
			<td>
				<p>Chú thích ảnh:<input type=="text" name="txtDiscription" size=="30"><br>
					<label for="upload_file">Chọn file ảnh</label>:<input type="file" name="upload[datafile]" size="40" /><br>
			</td>
		</tr>
		<tr>
			<td width="110">&nbsp;</td>
			<td>&nbsp;</td>
			<td><input type="submit" name="up" onclick="document.pressed=this.value" value="up" /><br>
			</td>
		</tr>
	</table>
</form>